<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>半口奶油数据中心</title>
		<script src="../js/jquery3.5.1.js"></script>
		<link rel="stylesheet" href="../css/index.css">
		<script src="../js/vue.js"></script>
		<!-- axios用来向后端发送请求-->
		<script src="../js/axios.js"></script>
		<script src="../js/elementui.js"></script>
		<script src="js/common.js"></script>
		<script src="../js/authChecker.js"></script>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="../layui/css/layui.css">
		<link rel="icon" sizes="32x32" href="../img/logo1.png" type="image/x-icon">

		<style>
			iframe {
				margin-top: 10px;
				border: none;
			}

			/* 退出按钮样式 */
			.logout-btn {
				position: fixed;
				/* 固定位置 */
				background-color: #FF1493;
				color: white;
				border: none;
				padding: 6px 10px;
				cursor: pointer;
				border-radius: 4px;
				margin-left: 1250px;
				font-size: 14px;
				margin-top: 10px;
			}

			.logout-btn:hover {
				opacity: 0.9;
			}
		</style>
	</head>
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header" style="background-color: admin;">
			<!-- logo蛋糕 -->
			<a href=" ">
				<img src="../img/logo横幅.png" width="180px" height="50px" style="margin-left: 10px;margin-top: 5px;">
			</a>

			<!-- 退出登录按钮 -->
			<button class="logout-btn" onclick="logout()">退出登录</button>
		</div>
		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" lay-filter="test">
					<li style="background-color: #FF1493;" value="0" class="layui-nav-item layui-nav-itemed">
						<a class="" href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff;">&#xe68e;</i>&nbsp;&nbsp;&nbsp;&nbsp;首页
						</a>
					</li>
					<li class="layui-nav-item" value="1">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe63a;</i>&nbsp;&nbsp;&nbsp;&nbsp;评论管理</a>
					</li>
					<li class="layui-nav-item" value="2">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe600;</i>&nbsp;&nbsp;&nbsp;&nbsp;商品管理</a>
					</li>
					<li class="layui-nav-item" value="3">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe63c;</i>&nbsp;&nbsp;&nbsp;&nbsp;订单管理</a>
					</li>
					<li class="layui-nav-item" value="4">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe627;</i>&nbsp;&nbsp;&nbsp;&nbsp;优惠券管理</a>
					</li>
					<li class="layui-nav-item" value="5">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe647;</i>&nbsp;&nbsp;&nbsp;&nbsp;分类管理</a>
					</li>
					<li class="layui-nav-item" value="6">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe6af;</i>&nbsp;&nbsp;&nbsp;&nbsp;营销活动管理</a>
					</li>
					<li class="layui-nav-item" value="7">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe66f;</i>&nbsp;&nbsp;&nbsp;&nbsp;用户管理</a>
					</li>
					<li class="layui-nav-item" value="9">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe715;</i>&nbsp;&nbsp;&nbsp;&nbsp;地址管理</a>
					<li class="layui-nav-item" value="8">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe657;</i>&nbsp;&nbsp;&nbsp;&nbsp;购物车管理</a>
					</li>
					<li class="layui-nav-item" value="10">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe64a;</i>&nbsp;&nbsp;&nbsp;&nbsp;轮播图管理</a>
					</li>
					<li class="layui-nav-item" value="24">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe637;</i>&nbsp;&nbsp;&nbsp;&nbsp;节日管理</a>
					</li>

					<li class="layui-nav-item" value="11">
						<a href="javascript:;">
							<i class="layui-icon"
								style="font-size: 15px; color: #fff">&#xe65e;</i>&nbsp;&nbsp;&nbsp;&nbsp;订单支付信息管理</a>
					</li>




				</ul>
			</div>
		</div>
		<div class="layui-body">
			<!-- <iframe id="mainbox" width="100%" height="100%" src="../createData/contentManagement.html"></iframe> -->
			<iframe id="mainbox" width="100%" height="100%" src="../createData/indexData.html"></iframe>
		</div>
	</div>
	</div>
	<script src="../layui/layui.js"></script>
	<script type="text/javascript">
		// 在页面加载时立即检查登录状态
		if (!checkAdminLogin()) {
			// 登录检查失败，阻止页面继续加载
			console.log('登录验证失败，已跳转至登录页');
		} else {
			$(".layui-nav-item").click(function() {
				$('.layui-nav-item').each(function() {
					$('.layui-nav-item').css("background", "#2f363c");
				});
				$(this).css("background", "#FF1493;");
				let text = $(this).val();
				if (text === 0) {
					$("#mainbox").attr("src", "../createData/indexData.html");
				} else if (text === 1) {
					$("#mainbox").attr("src", "../createData/contentManagement.html");
				} else if (text === 2) {
					$("#mainbox").attr("src", "../createData/goods.html");
				} else if (text === 3) {
					$("#mainbox").attr("src", "../createData/orders.html");
				} else if (text === 4) {
					$("#mainbox").attr("src", "../createData/quans.html");
				} else if (text === 5) {
					$("#mainbox").attr("src", "../createData/cates.html");
				} else if (text === 6) {
					$("#mainbox").attr("src", "../createData/themes.html");
				} else if (text === 7) {
					$("#mainbox").attr("src", "../createData/users.html");

				} else if (text === 9) {
					$("#mainbox").attr("src", "../createData/address.html");

				} else if (text === 8) {
					$("#mainbox").attr("src", "../createData/buycar.html");
				} else if (text === 10) {
					$("#mainbox").attr("src", "../createData/CarouselManagement.html");
				} else if (text === 24) {
					$("#mainbox").attr("src", "../createData/FestivalManage.html")

				} else if (text === 11) {
					$("#mainbox").attr("src", "../createData/message.html");
				}
			})
			//JS

			layui.use(['element', 'layer', 'util'], function() {
				var element = layui.element;
				var layer = layui.layer;
				var util = layui.util;
				var $ = layui.$;

				//头部事件
				util.event('lay-header-event', {
					menuLeft: function(othis) { // 左侧菜单事件
						layer.msg('展开左侧菜单的操作', {
							icon: 0
						});
					},
					menuRight: function() { // 右侧菜单事件
						layer.open({
							type: 1,
							title: '更多',
							content: '<div style="padding: 15px;">处理右侧面板的操作</div>',
							area: ['260px', '100%'],
							offset: 'rt', // 右上角
							anim: 'slideLeft', // 从右侧抽屉滑出
							shadeClose: true,
							scrollbar: false
						});
					}
				});
			});
		}
	</script>
	</body>
</html>